function getXhr(url, callback){
	var xhr=getXMLHttpRequest();

	xhr.onreadystatechange=function(){
		 if(xhr.readyState == 4 && (xhr.status==200 || xhr.status==0)){ //Lorsqu'on recoit une reponse
			callback(xhr.responseText);
		}
	};
	
	xhr.open("GET", url, true); 
	xhr.send();

};


function postXhr(url, args, callback){
	var xhr=getXMLHttpRequest();

	xhr.onreadystatechange=function(){
		 if(xhr.readyState == 4 && (xhr.status==200 || xhr.status==0)){ 
			callback(xhr.responseText);
		}
	};
	
	
	xhr.open("POST", url , true); 
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xhr.send(args);
};

function getXhrTimeout(url, nom_serveur, ping){
	var xhr = getXMLHttpRequest();
	
	xhr.onreadystatechange=function(){
		if(xhr.readyState == 4 && (xhr.status==0 || xhr.status==200)){ 
				ping.nbPing--;
		}
	};
	
	xhr.open("GET",url, true);
	xhr.send();
	
};